package com.ccrfid.rmc6.service.business.prison.door;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.business.prison.door.InOutDoorEntity;
import com.ccrfid.rmc6.entity.business.prison.door.InOutRecordDetailEntity;
import com.ccrfid.rmc6.entity.business.prison.door.InOutRecordEntity;
import com.ccrfid.rmc6.pojo.dto.prison.door.InOutCountDto;
import com.ccrfid.rmc6.pojo.dto.prison.door.InOutRecordDto;
import com.ccrfid.rmc6.repository.search.SearchCriteria;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface DoorService {

    //获取全部二道门信息
    List<InOutDoorEntity> getAllDoors();

    //获取账号关联二道门列表
//    List<InOutDoorEntity> getAllDoors(Long orgId);

    //获取单个二道门信息
    InOutDoorEntity getDoorById(Long doorId);

    //新增二道门信息
    InOutDoorEntity createDoor(InOutDoorEntity doorEntity) throws AppException;

    //修改二道门信息
    InOutDoorEntity updateDoor(Long doorId, InOutDoorEntity doorEntity) throws AppException;

    //删除二道门信息
    void deleteDoorById(Long doorId) throws AppException;

    //获取某个二道门带出/带入记录
    Page<InOutRecordEntity> getInOutRecords(SearchCriteria criteria, Pageable pageable);

    //获取某个带入/带出记录详细信息
    Page<InOutRecordDetailEntity> getInOutRecordDetail(SearchCriteria criteria, Pageable pageable);

    //开始一个带入/带出操作
    InOutRecordEntity startInOutRecord(Long doorId, String type, Long policeId, String policeName, String remark) throws AppException;

    //某个在押人员带入/离开
    InOutRecordDetailEntity createInOutRecordDetail(Long recordId, InOutRecordDetailEntity recordDetailEntity) throws AppException;

    //结束一个带入/带出操作
    InOutRecordEntity stopInOutRecord(Long recordId) throws AppException;

    //获取某天出工/收工情况的部门分类统计数据
    InOutCountDto getInOutCountByOrg(String dateStr);

    //执行一个带入/带出操作
    InOutRecordEntity takeInOut(Long doorId, String type, InOutRecordDto dto) throws AppException;
}
